Clojure Cookbook by Luke VanderHart & Ryan Neufeld

Clojure Cookbook by Luke VanderHart & Ryan Neufeld

Author:Luke VanderHart & Ryan Neufeld
Language: eng
Format: epub, mobi
Tags: COMPUTERS / Programming Languages / LISP
ISBN: 9781449366162
Publisher: O’Reilly Media
Published: 2014-03-05T16:00:00+00:00


(require '[langohr.queue :as lq]) (def resize-queue "imaging.resize") (lq/declare ch resize-queue) ;; -> {:queue "imaging.resize", ;; :consumer-count 0, ;; :message_count 0, ;; :consumer_count 0, ;; :message-count 0}

By default, RabbitMQ creates a binding between the empty exchange (an empty string) and each queue. You can now publish a message to the "imaging.resize" queue by invoking langohr.basic/publish with the channel, direct exchange, routing key (your queue name), and a message:

(lb/publish ch "" resize-queue "hello.jpg")

To consume messages from a queue synchronously, invoke langohr.basic/get with the channel and queue name:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.